package top.someapp.dxf2dsvg.kits;

/**
 * @author zwz
 * Created on 2020-04-20
 */
public class Nulls {
    private Nulls() {
        // prevent outer new instance
    }

    public static <T> T firstNonNull(T... ts) {
        for (T t : ts) {
            if (t != null)
                return t;
        }
        return null;
    }

    public static <T> T ifNull(T test, T valueIfNull) {
        if (test != null)
            return test;
        return valueIfNull;
    }
}
